﻿@using UCosmic
@using UCosmic.Www.Mvc.Controllers
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="-1" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content(Links.content.themes.@base.jquery_ui_all_css)" rel="stylesheet" />
    <link href="@Url.Content(Links.content.Site_css)?v=9" rel="stylesheet" />
    @if (IsSectionDefined("Styles"))
    { 
        @RenderSection("Styles")
    }

    <script src="@Url.Content(Links.scripts.jquery_1_7_1_js)" type="text/javascript"></script>

    <script src="@Url.Content(Links.scripts.jquery_ui_1_8_17_js)" type="text/javascript"></script>

    <script src="@Url.Content(Links.scripts.jquery_validate_js)" type="text/javascript"></script>

    <script src="@Url.Content(Links.scripts.jquery_validate_unobtrusive_js)" type="text/javascript"></script>

    <script src="@Url.Content(Links.scripts.jquery_unobtrusive_app_js)" type="text/javascript"></script>

    <script src="@Url.Content(Links.scripts.modernizr_2_0_6_development_only_js)" type="text/javascript"></script>

    <script src="@Url.Content(Links.scripts.ucosmic_js)" type="text/javascript"></script>

    @if (IsSectionDefined("Scripts"))
    { 
        @RenderSection("Scripts")
    }
</head>
<body data-ucosmic-ajax-error-log-url="@Url.Action(MVC.Common.Errors.LogAjaxError())" 
    data-ucosmic-ajax-error-log-message="An unknown error has occurred.
    @*maintain line break in message*@
If this continues, please notify info@ucosmic.org.">
    <div class="page">
        @{
            var topMessage = @TempData[BaseController.FeedbackMessageKey] as string;
        }
        @if (!string.IsNullOrWhiteSpace(topMessage))
        {
            var topMessageHtml = new MvcHtmlString(topMessage);     
            <div id="feedback_flash">
                @topMessageHtml
            </div>
            <script type="text/javascript">
                $(function () {
                    window.setTimeout(function () {
                        $('#feedback_flash').fadeOut(5000);
                    }, 10000);
                });
            </script>
        }
        <header>
            <div id="layout_title">
                <h1>
                    UCosmic</h1>
            </div>
            <div id="logindisplay" class="hat">
                @Html.Action(MVC.Identity.SignIn.SignOnStatus())
            </div>
            <nav>
                @Html.Action(MVC.Common.Navigation.HorizontalTabs())
            </nav>
        </header>
        <section id="main">
            @RenderBody()
        </section>
        <footer>
        </footer>
    </div>
    @if (WebConfig.IsDeployedTo(DeployToTarget.Preview))
    {

        <script type="text/javascript">
            var uvOptions = {};
            (function () {
                var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true;
                uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/BSIZVHgdyTZcEoXvv32mg.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s);
            })();
        </script>
    }
    @if (WebConfig.IsDeployedTo(DeployToTarget.Preview))
    {
        <script type="text/javascript">

            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-20616978-3']);
            _gaq.push(['_setDomainName', '.ucosmic.com']);
            _gaq.push(['_trackPageview']);
            _gaq.push(['_trackPageLoadTime']);

            (function () {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();

        </script>
    }
    <div style="display: none !important;">
        @if (IsSectionDefined("HeadCenter"))
        { 
            @RenderSection("HeadCenter")
        }
    </div>
</body>
</html>
